package com.guchenghao.controller;

import com.guchenghao.entity.Comment;
import com.guchenghao.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @User 20675
 * @Author gch
 * @Date 2025/4/1 14:25
 * @Description <br />
 * <p>
 * <br />
 */
@Controller
public class CommentController {
    @Autowired
    private CommentService commentService;

    // 保存用户发表的评论
    @PostMapping("/comment/save")
    @ResponseBody
    public Boolean saveComment(@RequestBody Comment comment) {
        return commentService.saveComment(comment);
    }
}
